home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
ansippv2
/
ansi.dat
next >
Wrap
Text File
|
1987-09-29
|
1KB
|
56 lines
#define x 3
#define f(a) f(x * (a))
#undef x
#define x 2
#define g f
#define z z[0]
#define h g(~
#define m(a) a(w)
#define w 0,1
#define t(a) a
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(2+(3,4)-w) | h 5) & m
(f)^m(m);
#undef f
#undef x
#undef x
#undef g
#undef z
#undef h
#undef m
#undef w
#undef t
#define str(s) # s
#define xstr(s) str(s)
#define debug(s, t) printf("x" #s "= %d, x" #t "= %s", \
x ## s, x ## t)
#define INCFILE(n) vers ## n
#define glue(a, b) a ## b
#define xglue(a, b) glue(a, b)
#define HIGHLOW "hello"
#define LOW LOW ", world"
debug(1, 2);
fputs(str(strncmp("abc\0d", "abc", '\4') /* this goes away */
== 0) str(: @\n), s);
#include xstr(INCFILE(2).h)
glue(HIGH, LOW)
xglue(HIGH, LOW)
#define OBJ_LIKE (1-1)
#define OBJ_LIKE /* white space */ (1-1) /* other */
#define FTN_LIKE(a) ( a )
#define FTN_LIKE( a )( /* note the white space */ \
a /* other stuff on this line
*/ )
Invalid macro redefinitions follow.
#define OBJ_LIKE (0) /* different token sequence */
#define OBJ_LIKE (1 - 1) /* different white space */
#define FTN_LIKE(b) ( a ) /* different parameter usage */
#define FTN_LIKE(b) ( b ) /* different parameter spelling */